🌐 HTTP Status Codes Explained
When you visit a website, your browser and the server communicate using the HTTP protocol.
Every request sent to the server returns a status code — a three-digit number that tells your browser what happened.
These codes are grouped into five categories:
1xx – Informational Responses
These indicate that the request was received and understood, but the process is continuing.
Code | Meaning |
---|---|
100 Continue | The server received the request headers and the client should proceed to send the body. |
101 Switching Protocols | The requester asked to switch protocols, and the server agreed. |
102 Processing | The server is still processing the request (used in WebDAV). |
103 Early Hints | Used to preload resources while the server prepares the final response. |
2xx – Success
These mean the request was successfully received, understood, and accepted.
Code | Meaning |
---|---|
200 OK | The request succeeded — the standard success response. |
201 Created | A new resource was successfully created. |
202 Accepted | The request was accepted for processing but not completed yet. |
203 Non-Authoritative Information | Returned metadata differs from the origin server’s copy. |
204 No Content | The request succeeded, but there’s no response body. |
205 Reset Content | Tells the client to reset the document view. |
206 Partial Content | Only part of the resource is being sent (for range requests). |
207 Multi-Status | Multiple results returned (used in WebDAV). |
208 Already Reported | Avoids reporting the same element multiple times (WebDAV). |
226 IM Used | The server fulfilled a GET request with instance manipulations applied. |
3xx – Redirection
These tell the browser that it must take additional action to complete the request.
Code | Meaning |
---|---|
300 Multiple Choices | Multiple options available for the resource. |
301 Moved Permanently | The resource has been permanently moved to a new URL. |
302 Found | The resource is temporarily available at another URL. |
303 See Other | Directs to another URL (typically after a POST). |
304 Not Modified | Resource hasn’t changed since last requested (used for caching). |
305 Use Proxy | Deprecated; indicated resource must be accessed via a proxy. |
307 Temporary Redirect | Temporary redirect — method unchanged. |
308 Permanent Redirect | Permanent redirect — method unchanged. |
4xx – Client Errors
These indicate a problem with the client’s request (e.g., bad syntax, unauthorized access).
Code | Meaning |
---|---|
400 Bad Request | The server couldn’t understand the request. |
401 Unauthorized | Authentication required or failed. |
402 Payment Required | Reserved for future use (often used for paywalls). |
403 Forbidden | The server understood the request but refuses to authorize it. |
404 Not Found | The requested resource doesn’t exist. |
405 Method Not Allowed | HTTP method not supported for this resource. |
406 Not Acceptable | The requested content type isn’t supported. |
407 Proxy Authentication Required | Client must authenticate with a proxy. |
408 Request Timeout | The client took too long to send a request. |
409 Conflict | The request conflicts with current server state. |
410 Gone | The resource has been permanently removed. |
411 Length Required | Content-Length header is missing. |
412 Precondition Failed | Preconditions in request headers failed. |
413 Payload Too Large | Request body is too large. |
414 URI Too Long | The request URI is too long to process. |
415 Unsupported Media Type | Media type is not supported. |
416 Range Not Satisfiable | Requested range can’t be fulfilled. |
417 Expectation Failed | The server can’t meet the “Expect” header requirements. |
418 I’m a Teapot | April Fool’s joke from RFC 2324 (Hyper Text Coffee Pot Control Protocol ☕). |
421 Misdirected Request | The request was sent to the wrong server. |
422 Unprocessable Content | Well-formed request but semantic errors. |
423 Locked | Resource is locked (WebDAV). |
424 Failed Dependency | Request failed due to previous failure (WebDAV). |
425 Too Early | Request too early to be processed safely. |
426 Upgrade Required | Client should switch to a different protocol. |
428 Precondition Required | The server requires conditional requests. |
429 Too Many Requests | Client sent too many requests (rate limiting). |
431 Request Header Fields Too Large | Headers are too large. |
451 Unavailable For Legal Reasons | Blocked due to legal restrictions. |
5xx – Server Errors
These indicate that the server failed to fulfill a valid request.
Code | Meaning |
---|---|
500 Internal Server Error | A generic error message for unexpected failures. |
501 Not Implemented | The server doesn’t support the requested functionality. |
502 Bad Gateway | Received an invalid response from the upstream server. |
503 Service Unavailable | The server is temporarily overloaded or under maintenance. |
504 Gateway Timeout | The upstream server didn’t respond in time. |
505 HTTP Version Not Supported | The HTTP version is not supported. |
506 Variant Also Negotiates | Content negotiation configuration error. |
507 Insufficient Storage | The server has insufficient storage to complete the request. |
508 Loop Detected | Infinite loop detected in processing (WebDAV). |
510 Not Extended | Further extensions to the request are required. |
511 Network Authentication Required | Client must authenticate to gain network access. |
✅ Summary
- 1xx – Informational
- 2xx – Success
- 3xx – Redirection
- 4xx – Client Errors
- 5xx – Server Errors
Understanding these codes helps developers troubleshoot issues, optimize performance, and improve user experience.